Repository navigation
Preserve Cargo workspace members' explicit authors - #5421
Open
Shrashti1234 wants to merge 1 commit into
Open
Shrashti1234 wants to merge 1 commit into
Shrashti1234 wants to merge 1 commit into
Conversation
Signed-off-by: Shrashti1234 <sharishhtia@gmail.com>
|
Took a look through \src/packagedcode/cargo.py\ and the updated test fixtures. Checking 'authors' in extra_data\ before overwriting \parties\ fixes the workspace inheritance logic nicely. Without that check, member crates were having their defined authors replaced by the workspace level package data even when they never set \�uthors.workspace = true. The updated fixture expectations in \�oring.expected.json\ show the concrete difference clearly, restoring the individual crate authors across the member crates. The parametrized matrix in \ est_cargo.py\ covers the inheritance combinations well. Clean fix and tests look solid! |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cargo workspace assembly currently replaces every member's authors with workspace.package.authors, even when the member has not requested inheritance. This can erase a member's explicit authors or attribute the workspace authors to a member that declares none.
For example, a member declaring authors = ["Member Author"] is reported with no authors when workspace.package only supplies version metadata. After this change its original author is preserved; authors.workspace = true continues to inherit the workspace authors, as specified in the Cargo workspace documentation.
Only update parties when the member's parsed metadata contains the authors inheritance marker. Add five end-to-end CLI cases covering explicit, inherited, and omitted authors with and without workspace authors. Update the existing boring workspace scan expectation to retain the authors already declared in its member manifests; all other expected fields are unchanged.
Validation on Windows / Python 3.14: